package com.atguigu.locks;

import java.util.concurrent.TimeUnit;

public class Lock8 {
    public static void main(String[] args) {
        Phone phone1 = new Phone();
        Phone phone2 = new Phone();
        new Thread(()->{phone1.sendEmail();},"t1").start();


        try {
            TimeUnit.SECONDS.sleep(1);
        }catch (Exception e){
            e.printStackTrace();
        }



        new Thread(()->{
            phone2.sendSMS();
//            phone1.hello();
//            phone1.sendSMS();
            },"t2").start();
    }
}
